package org.benben;

import java.util.regex.*;
import java.util.*;
import java.text.*;
import java.sql.*;

public class Utils
{
    public static final String[][] specialSymbol = 
    {
        {" ", " "},
        {"&copy;", "©"},
        {"&gt;", ">"},
        {"&lt;", "<"},
        {"&quot;", "\""},
        {"&amp;", "&"},
        {"&reg;", "®"},
        {"&trade;", "™"}
    };
    
    
    public static String formatText(String s)
    {
        String result = s.trim();
        
        result = result.replaceAll(" +", " ");
        
        return result;
    }
    
    public static String replaceSpecialSymbol(String s)
    {
        String result = s;
        
        for(int i = 0;i < specialSymbol.length;++i)
        {
            String key = specialSymbol[i][0];
            String value = specialSymbol[i][1];
           
            result = result.replaceAll(key, value);
        }
        
        return result;
    }
    
    public static long getTimer()
    {
        return System.currentTimeMillis();
    }
    
    public java.sql.Timestamp stringToTimstampe(String str)
    {
        return Timestamp.valueOf(str);
    }
    
    public String getCurrentTime()
    {
        return "";
    }
}

